import {fn} from '@/Echarts/进度2'
import * as echarts from 'echarts'
// const { echarts } = window

export default (element, data,self) => {
  const old = echarts.getInstanceByDom(element)
  if (old) old.dispose()
  const chart = echarts.init(element, 'theme')
  // eslint-disable-next-line no-unused-vars
  const options = fn(data.getname,data.getvalue)
  options.title[0].text = (data.number || '' ) + (data.unit ||'');
  options.title[1].text = data.title || '';
  chart.setOption(options)
  return chart
}
